import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
  path:"/",
  redirect:"/Login"
},
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
      {
        path: '/audit',
        name: 'Audit',
        component: () => import(/* webpackChunkName: "about" */ '../views/Audit/Audit.vue'),
        meta:{requiresAuth:true}
      },{
        path: '/broker',
        name: 'Broker',
        component: () => import(/* webpackChunkName: "about" */ '../views/Broker/Broker.vue'),
        meta:{requiresAuth:true}
      },{
        path: '/consultive',
        name: 'Consultive',
        component: () => import(/* webpackChunkName: "about" */ '../views/Consultive/Consultive.vue'),
        meta:{requiresAuth:true}
      },{
        path: '/group',
        name: 'Group',
        component: () => import(/* webpackChunkName: "about" */ '../views/Group/Group.vue'),
        meta:{requiresAuth:true}
      },{
        path: '/housing',
        name: 'Housing',
        component: () => import(/* webpackChunkName: "about" */ '../views/Housing/Housing.vue'),
      },{
        path: '/Order',
        name: 'Order',
        component: () => import(/* webpackChunkName: "about" */ '../views/Order/Order.vue'),
        meta:{requiresAuth:true}
      },{
        path: '/Streaming',
        name: 'Streaming',
        component: () => import(/* webpackChunkName: "about" */ '../views/Streaming/Streaming.vue'),
        meta:{requiresAuth:true}
      },
    ]
  },{
    path:"/login",
    component: () => import(/* webpackChunkName: "about" */ '../views/Login/Login.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
